<?php use app\models\Record; ?>
<main class="problem"><article style="width: 60%; <?php echo @$style1 ?>"><div class="ul table text"><div class="li"><div id="content"></div><div id="contentRaw" style="display: none">
<?php echo htmlspecialchars($problem['content']) ?>
</div><script>document.getElementById("content").innerHTML = marked(document.getElementById("contentRaw").innerText);</script></div></div></article>
<aside>
<div class="ul list"><div class="li"><h3>信息</h3>
<div style="font-size:17px;"><div class="listLeft">ID</div><?php echo $problem['id'] ?></div>
<div style="font-size:17px;"><div class="listLeft">题目提供者</div><?php echo @$problem['author_info'] ? '<a href="/user/?id=' . $problem['author_info']['id'] .'">' . $problem['author_info']['nickname'] . '</a>' : $problem['author'] ?></div>
<div style="font-size:17px;"><div class="listLeft">通过数</div><?php echo $recordsAC = (int)Record::getRecordsAC($problem['id']);?></div>
<div style="font-size:17px;"><div class="listLeft">提交数</div><?php echo $records = (int)Record::getRecords($problem['id']);?></div>
<div style="font-size:17px;"><div class="listLeft">通过率</div><?php echo ($records?(int)($recordsAC*100/$records):0).'%'; ?></div>
</div>
<div class="li">
<a href="/submit/?problem=<?php echo $problem['id'] ?>"><button class="blue"><i class="fa fa-file-code-o fa-lw"></i> 提交</button></a>
<a href="/record/?problem=<?php echo $problem['id'] ?>"><button class="blue"><i class="fa fa-bar-chart fa-lw"></i> 记录</button></a>
<a href="https://www.baidu.com/s?wd=<?php echo urlencode($problem['name'])?>"><button class="blue"><i class="fa fa-question-circle-o fa-lw"></i> 题解</button></a>
</div>
</div></aside>
</main>